package com.ato.MyCollection.MapTest;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

/**
 * @author wangjing
 * @create 2021--11--29--21:48
 */

/**
 *  主要用于读取配饰文件， key和value都是String
 */
public class PropertiesTest {
    public static void main(String[] args) throws IOException {
        Properties properties = new Properties();
//        读取文件。注意文件默认是读取根目录的
        FileInputStream fileInputStream = new FileInputStream("config.properties");
        properties.load(fileInputStream);
        Object user = properties.getProperty("user");
        System.out.println(user);
    }
}
